﻿@model TCM.Expense

@{
    ViewBag.Title = "Create";
}

<h2>New Expense</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Expense</legend> 
        <ol>      

       

       

        <li class="editor-label">
            @Html.LabelFor(model => model.ExpenseDate)
       
            @Html.TextBoxFor(model => model.ExpenseDate,new { @class = "datepicker" })
            @*@Html.ValidationMessageFor(model => model.ExpenseDate)*@
        </li>
              <li class="editor-label">
            @Html.LabelFor(model => model.ExpenseType)
        
            @Html.DropDownList("ExpenseType", String.Empty)      
           
        </li>
            <li class="editor-label">
            @Html.LabelFor(model => model.Price)
       
            @Html.EditorFor(model => model.Price)
            @*@Html.ValidationMessageFor(model => model.Price)*@
        </li>
        <li class="editor-label">
            @Html.LabelFor(model => model.Amount)
       
            @Html.EditorFor(model => model.Amount)
            @*@Html.ValidationMessageFor(model => model.Amount)*@
        </li>

      

        <li class="editor-label">
            @Html.LabelFor(model => model.TotalExpense)
       
            @Html.EditorFor(model => model.TotalExpense)
            @*@Html.ValidationMessageFor(model => model.TotalExpense)*@
        </li>

        <li class="editor-label">
            @Html.LabelFor(model => model.ResponsibleEmployee)
       
            @Html.DropDownList("ResponsibleEmployee", String.Empty)
            @*@Html.ValidationMessageFor(model => model.ResponsibleEmployee)*@
        </li>
             <li class="editor-label">
           <label> Description</label>
       
            @Html.EditorFor(model => model.Name)
            @*@Html.ValidationMessageFor(model => model.Name)*@
        </li>
      @*  <li class="editor-label OneColumn">
            @Html.LabelFor(model => model)
       
            @Html.TextAreaFor(model => model.Notes)
            @Html.ValidationMessageFor(model => model.Notes)
        </li>      *@ 

          

        <p>
            <input type="submit" value="Create" />
        </p>
        </ol>
    </fieldset>
}

<div>    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
<script type="text/javascript">

    $('input').blur(function () {
        $('#TotalExpense').val(parseFloat($('#Price').val()) * parseFloat($('#Amount').val()));
    });

</script>